package cn.wolfcode.luowowo.mgrsite.web;

import cn.wolfcode.luowowo.article.domain.Travel;
import cn.wolfcode.luowowo.article.query.TravelCommendQuery;
import cn.wolfcode.luowowo.article.service.ITravelCommendService;
import cn.wolfcode.luowowo.article.service.ITravlesService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("travelCommend")
public class TravelCommendController {




    @Reference
    private ITravelCommendService travelCommendService;
    @Reference
    private ITravlesService travlesService;




    @RequestMapping("/list")
    public String list(Model model, @ModelAttribute("qo")TravelCommendQuery qo){

       // details
        List <Travel> details = travlesService.list();
        model.addAttribute("details", details);
        model.addAttribute("pageInfo", travelCommendService.query(qo));

        return "travelCommend/list";
    }




}
